import { myUserinfo } from '@/api/login'

export default {
  namespaced: true,
  state: {
    token: '',
    UserInfo: ''
  },
  mutations: {
    setToken (state, value) {
      state.token = value
    },
    setUserInfo (state, value) {
      state.UserInfo = value
    },
    logout (state) {
      state.token = ''
      state.UserInfo = ''
    }
  },
  actions: {
    async getUserInfo (store) {
      const res = await myUserinfo()
      store.commit('setUserInfo', res.data)
      console.log('用户信息', res)
    }
  },
  getters: {}
}
